import { App } from 'vue';
import { withInstall } from '@ibiz-template/vue3-util';
import { registerPanelItemProvider } from '@ibiz-template/runtime';
import { PanelCtrlPosTabExp } from './panel-ctrl-pos-tab-exp';
import { PanelCtrlPosTabExpProvider } from './panel-ctrl-pos-tab-exp.provider';

const IBizPanelCtrlPosTabExp = withInstall(
  PanelCtrlPosTabExp,
  function (v: App) {
    v.component(PanelCtrlPosTabExp.name!, PanelCtrlPosTabExp);
    registerPanelItemProvider(
      'CUSTOM_PANEL_CTRL_POS_TAB_EXP',
      () => new PanelCtrlPosTabExpProvider(),
    );
  },
);

export default {
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type
  install(app: App) {
    app.use(IBizPanelCtrlPosTabExp);
  },
};
